﻿@model System.Collections.Generic.List<KRM.Core.tblPosition>

@{
    ViewBag.Title = "Positions Management";
    Layout = "/views/shared/_HRLayout.cshtml";
}
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            Positions <small>Positions Management</small>
        </h3>
                 <ul class="page-breadcrumb breadcrumb" style="margin-bottom: 10px;">
                  <li>
                     <i class="icon-home"></i>
                     <a href="/Home">Home</a> 
                     <span class="icon-angle-right"></span>
                  </li>
                  <li>
                     <a href="/Employees">Management</a>
                     <span class="icon-angle-right"></span>
                  </li>
                  <li><a href="/Position/">Positions</a></li>
               </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<div class="row">
    
    <div id="PositionDetail" class="modal fade" tabindex="-1" data-width="600">
        <div style="height: 360px">
            <div style="height: 170px"></div>
            <div class="ajax-loading"></div>
        </div>    
    </div>
    <div id="addPosition" class="modal fade" tabindex="-1" data-width="600">
        @Html.Partial("Create")  
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        @Html.Partial("Partial/_MessageResult")
    </div>
</div>
<div class="row">
    
    <div class="col-md-6 table-toolbar" >
        <a href="#addPosition"  data-toggle="modal"class="btn green">Add New <i class="icon-plus"></i></a>
    </div>
    <form class="form-horizontal col-md-6" >
        <div class="row">
            <label class="control-label col-md-3">Department:</label>
            <div class="input-icon col-md-9">
                @Html.DropDownList("DepartmentIdFilter",null,new {@class="form-control",onchange="window.location='/Position/?departmentid='+this.value"})
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-md-12"> <table class="table table-striped table-bordered table-hover dataTable " >
                                <thead>
                                    <tr>
                                        <th class="">Name</th>
                                        <th  >Department</th>
                                        <th  >Description</th>
                                        <th style="width: 80px">Edit</th>
                                        <th style="width: 88px">Delete</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @foreach (var item   in Model)
                                    {     
                                        <tr>
                                            <td style="text-align: center">@item.Name</td>
                                            <td style="text-align: center">@item.tblHRDepartment.DepartmentName</td>
                                            <td style="text-align: center">@item.Description</td>
                                            <td style="text-align: center">
                                                <a type="button" onclick="ViewPositionDetail(@item.Id)" href="#PositionDetail"data-toggle="modal" class="btn btn-sm blue">View <i class="icon-edit"></i></a>
                                            </td>
                                            <td style="text-align: center">
                                                <a href="/Position/Delete/@item.Id" onclick="javascript:return confirm('Are you sure?');" class="btn btn-sm red">Delete <i class="icon-remove"></i></a>
                                            </td>
                                        </tr>
                                    }
                                </tbody>
                            </table>
    </div>
</div>